/**
    plugin.h - Header file for plugin.c
    Copyright (C) 2009  Abram Magner

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PLUGIN_H
  #define PLUGIN_H

  #include "list.h"
  #include "woofs_plugin.h"

  typedef list plugin_set;
  typedef list_node plugin_set_iter;

  typedef struct format_plugin
  {
    void *plugin_handle;
    woofs_format_plugin *plugin_struct;
  } format_plugin;

  format_plugin *plugin_claimfile (plugin_set *, int, char *);
  int plugin_scandir (plugin_set *, char *);
  int plugin_verify (format_plugin *);

  plugin_set *plugin_set_new (void);
  int plugin_set_add (plugin_set *, format_plugin *);
  plugin_set_iter *plugin_set_get_iter (plugin_set *);
  void plugin_set_iter_advance (plugin_set_iter **);
  int plugin_set_iter_hasmore (plugin_set_iter *);
  void plugin_set_fini (plugin_set *);

#endif
